home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1999 April / Cd Pc Users extra 19 abril 1999.iso / Prog / Inst / MagicFrm / magicfrm.exe / FRMSystemTray.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-01-20  |  6.7 KB  |  214 lines

  1. VERSION 5.00
  2. Object = "{B3ECB8C8-B046-11D2-B522-D0863DEC394B}#1.0#0"; "MagicFrm.ocx"
  3. Begin VB.Form FRMSystemTray 
  4.    Caption         =   "Exemplo do uso do SystemTray"
  5.    ClientHeight    =   3300
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   3930
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3300
  11.    ScaleWidth      =   3930
  12.    ShowInTaskbar   =   0   'False
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.Frame FRMIcones 
  15.       Caption         =   "Clique em um dos 
  16. cones para alterar"
  17.       Height          =   915
  18.       Left            =   0
  19.       TabIndex        =   2
  20.       Top             =   1200
  21.       Width           =   3795
  22.       Begin VB.PictureBox PICElement 
  23.          Height          =   550
  24.          Index           =   0
  25.          Left            =   120
  26.          Picture         =   "FRMSystemTray.frx":0000
  27.          ScaleHeight     =   495
  28.          ScaleWidth      =   495
  29.          TabIndex        =   8
  30.          ToolTipText     =   "Click Here To Change The TrayIcon"
  31.          Top             =   240
  32.          Width           =   550
  33.       End
  34.       Begin VB.PictureBox PICElement 
  35.          Height          =   550
  36.          Index           =   1
  37.          Left            =   720
  38.          Picture         =   "FRMSystemTray.frx":0442
  39.          ScaleHeight     =   495
  40.          ScaleWidth      =   495
  41.          TabIndex        =   7
  42.          ToolTipText     =   "Click Here To Change The TrayIcon"
  43.          Top             =   240
  44.          Width           =   550
  45.       End
  46.       Begin VB.PictureBox PICElement 
  47.          Height          =   550
  48.          Index           =   2
  49.          Left            =   1320
  50.          Picture         =   "FRMSystemTray.frx":0884
  51.          ScaleHeight     =   495
  52.          ScaleWidth      =   495
  53.          TabIndex        =   6
  54.          ToolTipText     =   "Click Here To Change The TrayIcon"
  55.          Top             =   240
  56.          Width           =   550
  57.       End
  58.       Begin VB.PictureBox PICElement 
  59.          Height          =   550
  60.          Index           =   3
  61.          Left            =   1920
  62.          Picture         =   "FRMSystemTray.frx":0CC6
  63.          ScaleHeight     =   495
  64.          ScaleWidth      =   495
  65.          TabIndex        =   5
  66.          ToolTipText     =   "Click Here To Change The TrayIcon"
  67.          Top             =   240
  68.          Width           =   550
  69.       End
  70.       Begin VB.PictureBox PICElement 
  71.          Height          =   550
  72.          Index           =   4
  73.          Left            =   2520
  74.          Picture         =   "FRMSystemTray.frx":1108
  75.          ScaleHeight     =   495
  76.          ScaleWidth      =   495
  77.          TabIndex        =   4
  78.          ToolTipText     =   "Click Here To Change The TrayIcon"
  79.          Top             =   240
  80.          Width           =   550
  81.       End
  82.       Begin VB.PictureBox PICElement 
  83.          Height          =   550
  84.          Index           =   5
  85.          Left            =   3120
  86.          Picture         =   "FRMSystemTray.frx":154A
  87.          ScaleHeight     =   495
  88.          ScaleWidth      =   495
  89.          TabIndex        =   3
  90.          ToolTipText     =   "Click Here To Change The TrayIcon"
  91.          Top             =   240
  92.          Width           =   550
  93.       End
  94.    End
  95.    Begin VB.TextBox TXTTip 
  96.       Height          =   285
  97.       Left            =   60
  98.       MaxLength       =   60
  99.       TabIndex        =   1
  100.       Text            =   "Digite um texto aqui para aparecer na bandeja"
  101.       Top             =   405
  102.       Width           =   3615
  103.    End
  104.    Begin VB.CheckBox CHKShowIcon 
  105.       Caption         =   "Exibir 
  106. cone"
  107.       Height          =   255
  108.       Left            =   60
  109.       TabIndex        =   0
  110.       Top             =   780
  111.       Width           =   1275
  112.    End
  113.    Begin MagicForms.SystemTray SystemTray1 
  114.       Left            =   2280
  115.       Top             =   720
  116.       _ExtentX        =   2223
  117.       _ExtentY        =   847
  118.       Icon            =   "FRMSystemTray.frx":198C
  119.    End
  120.    Begin VB.Label Label3 
  121.       Caption         =   "Right Click on the SystemTray Icon to see a popup menu made width Visual Basic."
  122.       ForeColor       =   &H000000FF&
  123.       Height          =   495
  124.       Left            =   60
  125.       TabIndex        =   11
  126.       Top             =   2700
  127.       Width           =   3795
  128.    End
  129.    Begin VB.Label Label2 
  130.       Caption         =   "Clique com o bot
  131. o direito no Icone SystemTray para ver um menu popup feito pelo Visual Basic."
  132.       Height          =   495
  133.       Left            =   60
  134.       TabIndex        =   10
  135.       Top             =   2160
  136.       Width           =   3795
  137.    End
  138.    Begin VB.Label Label1 
  139.       Caption         =   "TipText / Texto da Dica"
  140.       Height          =   255
  141.       Left            =   60
  142.       TabIndex        =   9
  143.       Top             =   180
  144.       Width           =   1875
  145.    End
  146.    Begin VB.Menu MNUPopUp 
  147.       Caption         =   "MenuPopUp"
  148.       Visible         =   0   'False
  149.       Begin VB.Menu MNUMaximize 
  150.          Caption         =   "Maximizar"
  151.       End
  152.       Begin VB.Menu MNUMinimize 
  153.          Caption         =   "Minimizar"
  154.       End
  155.       Begin VB.Menu MNURestore 
  156.          Caption         =   "Restaurar"
  157.       End
  158.       Begin VB.Menu mnuseparador 
  159.          Caption         =   "-"
  160.       End
  161.       Begin VB.Menu MNUEnd 
  162.          Caption         =   "Sair"
  163.       End
  164.       Begin VB.Menu MNUAbout 
  165.          Caption         =   "Sobre / About"
  166.       End
  167.    End
  168. Attribute VB_Name = "FRMSystemTray"
  169. Attribute VB_GlobalNameSpace = False
  170. Attribute VB_Creatable = False
  171. Attribute VB_PredeclaredId = True
  172. Attribute VB_Exposed = False
  173. Private Sub CHKShowIcon_Click()
  174. If CHKShowIcon.Value = 1 Then
  175.     FRMIcones.Visible = True
  176.     SystemTray1.Show
  177.     FRMIcones.Visible = False
  178.     SystemTray1.Hide
  179. End If
  180. End Sub
  181. Private Sub Form_Load()
  182. CHKShowIcon.Value = 1
  183. End Sub
  184. Private Sub MNUAbout_Click()
  185. SystemTray1.Sobre
  186. End Sub
  187. Private Sub MNUEnd_Click()
  188. End Sub
  189. Private Sub MNUMaximize_Click()
  190. Me.WindowState = 2
  191. End Sub
  192. Private Sub MNUMinimize_Click()
  193. Me.WindowState = 1
  194. End Sub
  195. Private Sub MNURestore_Click()
  196. Me.WindowState = 0
  197. End Sub
  198. Private Sub PICElement_Click(Index As Integer)
  199. 'Lembre-se de usar "SET" para alterar o icone
  200. 'Remember to use "SET" to change the icon
  201. Set SystemTray1.Icon = PICElement(Index).Picture
  202. End Sub
  203. Private Sub SystemTray1_LeftButtonDown()
  204. MsgBox "Voc
  205.  clicou aqui" & Chr(10) & "You clicked here"
  206. Me.Show
  207. End Sub
  208. Private Sub SystemTray1_RightButtonUp()
  209. PopupMenu MNUPopUp
  210. End Sub
  211. Private Sub TXTTip_Change()
  212. SystemTray1.TextoDica = TXTTip.Text
  213. End Sub
  214.